package com.multysite.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;

import javax.persistence.Id;

import com.googlecode.objectify.annotation.Cached;
import com.googlecode.objectify.annotation.Indexed;
import com.googlecode.objectify.annotation.Unindexed;
import com.multysite.util.StringHelper;

@Cached
public class News implements Serializable {
	public static final long serialVersionUID = 1L;
	@Id
	private String alias = "";
	@Unindexed
	private String title = "";
	@Unindexed
	private String content = "";
	@Unindexed
	private String source = "";
	@Unindexed
	private String category = "";
	@Unindexed
	private String thumb = "";
	@Indexed
	private String categoryAlias = "";
	@Indexed
	private Date date = Calendar.getInstance().getTime();
	/*
	 * <tag-01, Tag 01>,<tag-02, Tag 02>
	 */
	@Unindexed
	private ArrayList<String> tags = new ArrayList<String>();

	public String getSubContent() {
		return StringHelper.cutDescription(content);
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getThumb() {
		return thumb;
	}

	public void setThumb(String thumb) {
		this.thumb = thumb;
	}

	public String getCategoryAlias() {
		return categoryAlias;
	}

	public void setCategoryAlias(String categoryAlias) {
		this.categoryAlias = categoryAlias;
	}

	public String getDate() {
		return date.toString();
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public ArrayList<String> getTags() {
		return tags;
	}

	public void setTags(ArrayList<String> tags) {
		this.tags = tags;
	}

}
